package com.wangnian.wangcai.service.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class ApiChannel {

    @Value("${channel}")
    private String channel;

    @Autowired
    private QmtService qmtService;

    @Autowired
    private ThsService thsService;

    public static ApiService apiService;

    @PostConstruct
    public void init() {
        if ("qmt".equals(channel)) {
            apiService = qmtService;
        } else {
            apiService = thsService;
        }
    }

}
